#!/bin/bash
FILENAME="$1"
export SAD_ROOT=/Users/shuguang.wang/mycode/ai_community/SadTalker
export CHAT_ROOT=/Users/shuguang.wang/mycode/ai_community/Langchain-Chatchat/libs/chatchat-server
cd $SAD_ROOT
source ./venv/bin/activate
cp "${CHAT_ROOT}/${FILENAME}" "${SAD_ROOT}/william/${FILENAME}"
video_file=$(date +%s)
python inference.py --driven_audio $SAD_ROOT/william/${FILENAME} --source_image $SAD_ROOT/william/1.jpg --result_dir $SAD_ROOT/william/$video_file  --enhancer gfpgan
rm $SAD_ROOT/william/human.mp4
cp $SAD_ROOT/william/$video_file/*.mp4 $SAD_ROOT/william/human.mp4

